import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import elementPlus, { ElLoading } from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/es/components/loading/src/service'
import VueCookies from 'vue-cookies'
import '@/assets/css/common.css'
import $ from 'jquery'

let loading = null
axios.defaults.baseURL = 'http://localhost:3000/'
axios.interceptors.request.use(function (config) {
   loading = ElLoading.service({ fullscren: true })
   return config
})
axios.interceptors.response.use(function (result) {
   loading.close()
   return result
})
const app = createApp(App)
window.$ = $
app.config.globalProperties.$http = axios
app.config.globalProperties.$cookies = VueCookies // 全局配置cookie
app.use(store).use(router).use(elementPlus).mount('#app')
